<!doctype html>
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Qlik Sense Mashup</title>
    <meta charset="utf-8">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="cleartype" content="on">
    <link rel="stylesheet" href="https://s01.demo.krclouds.com/resources/autogenerated/qlik-styles.css">
    <link rel="stylesheet" href="app.css">
    <link rel="stylesheet" href="./cashFlow.css">
    <script src="https://s01.demo.krclouds.com/resources/assets/external/requirejs/require.js"></script>
    <script src="Page.Config.js"></script>
    <script src="app.js"></script>
</head>
<script>
    function handleToChange(index) {
        console.log("----11111--", index);
        if (index === 'home') {
            console.log("----11111--", index);
        } else if (index === 'cashFlow') {
            window.location.href = 'cashFlow.html';
        } else if (index === 'pl') {
            window.location.href = 'pl.html';
        } else if (index === 'sales') {
            window.location.href = 'index.html';
        }
    }

    function handleToPro() {
        window.location.href = 'financeProfitLoss.html';
    }

    function handleToCap() {
        window.location.href = 'cashFlow.html';
    }

    function handleChangeFinance() {
        //按钮增加active样式
        document.getElementById("BtnFinance").classList.add("active");
        document.getElementById("BtnService").classList.remove("active");
        document.getElementById("BtnFreeMoney").classList.remove("active");

        //content显示Finance1~4 --隐藏other
        document.getElementById("QVFinance1").style.visibility = "visible";
        document.getElementById("QVFinance2").style.visibility = "visible";
        document.getElementById("QVFinance3").style.visibility = "visible";
        document.getElementById("QVFinance4").style.visibility = "visible";

        document.getElementById("QVService1").style.visibility = "hidden";
        document.getElementById("QVService2").style.visibility = "hidden";
        document.getElementById("QVService3").style.visibility = "hidden";
        document.getElementById("QVService4").style.visibility = "hidden";
        document.getElementById("QVFreeMoney1").style.visibility = "hidden";
        document.getElementById("QVFreeMoney2").style.visibility = "hidden";
        document.getElementById("QVFreeMoney3").style.visibility = "hidden";
        document.getElementById("QVFreeMoney4").style.visibility = "hidden";
    }

    function handleChangeService() {
        document.getElementById("BtnService").classList.add("active");
        document.getElementById("BtnFinance").classList.remove("active");
        document.getElementById("BtnFreeMoney").classList.remove("active");
        //content显示Service1~4 --隐藏1
        document.getElementById("QVService1").style.visibility = "visible";
        document.getElementById("QVService2").style.visibility = "visible";
        document.getElementById("QVService3").style.visibility = "visible";
        document.getElementById("QVService4").style.visibility = "visible";

        document.getElementById("QVFinance1").style.visibility = "hidden";
        document.getElementById("QVFinance2").style.visibility = "hidden";
        document.getElementById("QVFinance3").style.visibility = "hidden";
        document.getElementById("QVFinance4").style.visibility = "hidden";
        document.getElementById("QVFreeMoney1").style.visibility = "hidden";
        document.getElementById("QVFreeMoney2").style.visibility = "hidden";
        document.getElementById("QVFreeMoney3").style.visibility = "hidden";
        document.getElementById("QVFreeMoney4").style.visibility = "hidden";
    }

    function handleChangeFreeMoney() {
        document.getElementById("BtnFreeMoney").classList.add("active");
        document.getElementById("BtnService").classList.remove("active");
        document.getElementById("BtnFinance").classList.remove("active");
        //content显示QVFreeMoney1~4 --隐藏1
        document.getElementById("QVFreeMoney1").style.visibility = "visible";
        document.getElementById("QVFreeMoney2").style.visibility = "visible";
        document.getElementById("QVFreeMoney3").style.visibility = "visible";
        document.getElementById("QVFreeMoney4").style.visibility = "visible";

        document.getElementById("QVFinance1").style.visibility = "hidden";
        document.getElementById("QVFinance2").style.visibility = "hidden";
        document.getElementById("QVFinance3").style.visibility = "hidden";
        document.getElementById("QVFinance4").style.visibility = "hidden";
        document.getElementById("QVService1").style.visibility = "hidden";
        document.getElementById("QVService2").style.visibility = "hidden";
        document.getElementById("QVService3").style.visibility = "hidden";
        document.getElementById("QVService4").style.visibility = "hidden";
    }
</script>

<body style="overflow: auto">
    <div class="header">
        <div class="headerName">SGC Sales Operation Dashboards</div>
        <div class="pageChange">
            <!-- <div class="home" onclick="handleToChange('home')">
                <div>
                    <img src="./img/header/head-home.png" />
                </div>
                <div>Home</div>
            </div> -->
            <!-- <div class="cashFlow" onclick="handleToChange('cashFlow')">
                <div>
                    <img src="./img/header/head-cashflow.png" />
                </div>
                <div>Cash Flow</div>
            </div> -->
            <div class="pl" onclick="handleToChange('pl')">
                <div>
                    <img src="./img/header/FinanceClick.png" />
                </div>
                <div class="activeText">Finance</div>
            </div>
            <div class="sales" onclick="handleToChange('sales')">
                <div>
                    <img src="./img/header/head-sales.png" />
                </div>
                <div>Sales</div>
            </div>
        </div>
    </div>
    <div class="line">
        <div class="color1"></div>
        <div class="color2"></div>
        <div class="color3"></div>
    </div>
    <div class="toggleBtn">
        <!-- 损益/资金 切换按钮 -->
        <div class="profitLoss " onclick="handleToPro()">损益</div>
        <div class="capital active" onclick="handleToCap()">资金</div>
    </div>
    <div class="content1">
        <div class="content">
            <div class="headers">
                <img src="./img/cashFlow/cashflow-kpi-cpicon.png" />
                <div class="name">CP</div>
            </div>
            <!-- CP -->
            <div class="contents" id="QVCP">
            </div>
        </div>
        <div class="dark"></div>
        <div class="content">
            <div class="headers">
                <img src="./img/cashFlow/cashflow-kpi-cnicon.png" />
                <div class="name">CN</div>
            </div>
            <!-- CN -->
            <div class="contents" id="QVCN">
            </div>
        </div>
        <div class="dark"></div>
        <div class="content">
            <div class="headers">
                <img src="./img/cashFlow/cashflow-kpi-seedicon.png" />
                <div class="name">Seed</div>
            </div>
            <!-- Seed -->
            <div class="contents" id="QVSeed">
            </div>
        </div>
        <div class="dark"></div>
        <div class="content">
            <div class="headers">
                <img src="./img/cashFlow/cashflow-kpi-mapicon.png" />
                <div class="name">MAP</div>
            </div>
            <!-- MAP -->
            <div class="contents" id="QVMAP">
            </div>
        </div>
        <div class="dark"></div>
    </div>
    <div class="content2">
        <div class="content2Header">
            <div class="leftExplain">
                <div class="headerName"><img src="./img/cashFlow/cashflow-qushiicon.png" />趋势分析图</div>
                <div class="icons">
                    <img src="./img/pl/thisYear.png" />
                    <div class="name">今年</div>
                    <img src="./img/pl/lastYear.png" />
                    <div class="name">去年</div>
                </div>
            </div>
            <div class="rightButton">
                <!-- 切换按钮 -->
                <div id="BtnFinance" class="button1 active" onclick="handleChangeFinance()">财务费用</div>
                <div id="BtnService" class="button1" onclick="handleChangeService()">营运资金</div>
                <div id="BtnFreeMoney" class="button2" onclick="handleChangeFreeMoney()">自由现金流</div>
            </div>
        </div>
        <div class="main2Content">
            <!-- 财务费用 -->
            <div class="content">
                <div class="histogram" id="QVFinance1">
                </div>
                <div class="histogram" id="QVFinance2">
                </div>
                <div class="histogram" id="QVFinance3">
                </div>
                <div class="histogram" id="QVFinance4">
                </div>
            </div>
            <!-- 营运资金 -->
            <div class="content">
                <div class="histogram" id="QVService1" style="visibility: hidden;">
                </div>
                <div class="histogram" id="QVService2" style="visibility: hidden;">
                </div>
                <div class="histogram" id="QVService3" style="visibility: hidden;">
                </div>
                <div class="histogram" id="QVService4" style="visibility: hidden;">
                </div>
            </div>
            <!-- 自由现金流 -->
            <div class="content">
                <div class="histogram" id="QVFreeMoney1" style="visibility: hidden;">
                </div>
                <div class="histogram" id="QVFreeMoney2" style="visibility: hidden;">
                </div>
                <div class="histogram" id="QVFreeMoney3" style="visibility: hidden;">
                </div>
                <div class="histogram" id="QVFreeMoney4" style="visibility: hidden;">
                </div>
            </div>
        </div>

    </div>
    <div class="content3">
        <div class="pie">
            <div class="headers">
                <img src="./img/cashFlow/cashflow-actualCostsicon.png" /> 财务费用实际
            </div>
            <!-- 柱状图1 -->
            <div class="content" id="QVPie1"></div>

        </div>
        <div class="pie">
            <div class="headers">
                <img src="./img/cashFlow/cashflow-operationicon.png" />营运资金
            </div>
            <!-- 柱状图2 -->
            <div class="content" id="QVPie2"></div>

        </div>
        <div class="pieBig">
            <div class="headers">
                <div><img src="./img/cashFlow/cashflow-freeicon.png" />自由现金流</div>
                <div class="colorLump">
                    <div class="color" style="background-color: #5E9A01;"></div>
                    <div class="name">Positive</div>
                    <div class="color" style="background-color: #FB951E ;"></div>
                    <div class="name">Negative</div>
                    <div class="color" style="background-color: #4477AA;"></div>
                    <div class="name">Subtotal</div>

                </div>
            </div>
            <!-- 柱状图3 -->
            <div class="content" id="QVPie3"></div>
        </div>

    </div>

</body>

</html>